#ifndef TRANSACTIONVIEWADDDIALOG_H
#define TRANSACTIONVIEWADDDIALOG_H

#include <QtGui>
#include "core/customercontroller.h"
#include "core/itemcontroller.h"
#include "core/stockcontroller.h"
#include "core/stockmodel.h"
#include "core/transactionmodel.h"
#include "gui/shinylist.h"
#include "gui/separatorwidget.h"

class TransactionViewAddDialog : public QDialog
{
    Q_OBJECT
public:
    explicit TransactionViewAddDialog(QWidget *parent = 0);
    TransactionModel *getTransaction();

signals:

public slots:
    void onStockClearAllClicked();
    void onStockAddClicked();
    void onSaveButtonClicked();

protected:
    void initUiComponents();
    void initSignalsAndSlots();

    QComboBox *createCustomerBox();
    QComboBox *createItemBox();
    QComboBox *createStockBox();
    QGroupBox *createStockArea();

    CustomerModel *getCustomer();
    QString getDeliveryStatus();

    QList<StockModel *> stocks;
    QList<CustomerModel *> customers;
    TransactionModel *transaction;

    QVBoxLayout *mainLayout;
    QGridLayout *gridLayout;

    QLabel *headerLabel;
    QLabel *subHeaderLabel;

    QLabel *customerLabel;
    QComboBox *customerBox;

    QLabel *deliveryStatusLabel;
    QComboBox *deliveryStatusBox;

    QLabel *paidLabel;
    QComboBox *paidBox;

    QGroupBox *stockGroupBox;
    QVBoxLayout *stockMainLayout;

    ShinyList *slist;

    QGridLayout *stockButtonLayout;
    QLabel *itemLabel;
    QComboBox *itemBox;
    QLabel *stockLabel;
    QComboBox *stockBox;
    QDialogButtonBox *stockControlButtonsBox;

    QLabel *actualPriceLabel;
    QLineEdit *actualPriceEdit;

    QCheckBox *validityBox; // this is for Transaction Edit dialog

    QDialogButtonBox *buttonBox;
};

#endif // TRANSACTIONVIEWADDDIALOG_H
